home *** CD-ROM | disk | FTP | other *** search
- package icontrols.RichText;
-
- import com.ms.dll.Callback;
- import com.ms.dll.DllLib;
- import com.ms.wd.io.IOException;
-
- final class EditStreamProc extends Callback {
- private RichText richText;
-
- public EditStreamProc(RichText richText) {
- this.richText = richText;
- }
-
- public int callback(int dwCookie, int buf, int cb, int transferred) {
- int ret = 0;
- int[] trans = new int[1];
- DllLib.copy(transferred, trans, 0, 1);
-
- try {
- switch (dwCookie) {
- case 0:
- trans[0] = this.richText.bis.read(buf, cb);
- if (trans[0] < 0) {
- trans[0] = 0;
- }
- break;
- case 1:
- this.richText.bos.write(buf, cb);
- trans[0] = cb;
- }
- } catch (IOException var8) {
- trans[0] = 0;
- ret = 1;
- }
-
- DllLib.copy(trans, 0, transferred, 1);
- return ret;
- }
- }
-